<template>
	<div class="home">
		<Header />
		<infoer :epidemicinfo="epidemicinfo" />
		<caseNumer :caseNumData="caseNumData" />
		<Map />
		<MySwiper />
		<SpringTravel />
		<News :newsData="newsData" />
	</div>
</template>

<script>
	import api from "../api";
	import Header from "../components/Head.vue";
	import infoer from "../components/info.vue";
	import caseNumer from "../components/caseNum.vue";
	import Map from "../components/map.vue";
	import MySwiper from "../components/myswiper.vue";
	import SpringTravel from "../components/SpringTravel.vue";
	import News from "../components/News.vue";
	export default {
		name: "Home",
		data() {
			return {
				//疫情信息:info
				epidemicinfo: {
					notel1: "",
					notel2: "",
					notel3: "",
					remark1: "",
					remark2: "",
					remark3: ""
				},
				//疫情病例
				caseNumData: {
					modifyTime: "", //数据更新时间
					currentConfirmedCount: "", //现存确诊人数
					confirmedCount: "", //累计确诊人数
					suspectedCount: "", //累计境外输入人数
					curedCount: "", //累计治愈人数
					deadCount: "", //累计死亡人数
					seriousCount: "", //现存无症状人数
					suspectedIncr: "", //新增境外人数
					currentConfirmedIncr: "", //相比昨天现存确诊人数
					confirmedIncr: "", //相比昨天累计确诊人数
					curedIncr: "", //相比昨天新增治愈人数
					deadIncr: "", //相比昨天新增死亡人数
					seriousIncr: "", //相比昨天现存无症状人数
				},
				//疫情新闻
				newsData: []
			}
		},
		components: {
			Header,
			infoer,
			caseNumer,
			Map,
			MySwiper,
			SpringTravel,
			News
		},
		mounted() {
			api.getinfoData({
				key: "d7c335f2e7856ec48c1962a99fcc6f98"
			}).then(res => {
				console.log(res);
				//疫情信息
				// this.epidemicinfo.notel1 = res.newslist[0].desc.note1,
				// this.epidemicinfo.notel2 = res.newslist[0].desc.note2,
				// this.epidemicinfo.notel3 = res.newslist[0].desc.note3,
				// this.epidemicinfo.remark1 = res.newslist[0].desc.remark1,
				// this.epidemicinfo.remark2 = res.newslist[0].desc.remark2,
				// this.epidemicinfo.remark3 = res.newslist[0].desc.remark3,
				//疫情病例
				this.caseNumData.modifyTime = res.data.newslist[0].desc.modifyTime
				this.caseNumData.currentConfirmedCount = res.data.newslist[0].desc.currentConfirmedCount
				this.caseNumData.confirmedCount = res.data.newslist[0].desc.confirmedCount
				this.caseNumData.suspectedCount = res.data.newslist[0].desc.suspectedCount
				this.caseNumData.curedCount = res.data.newslist[0].desc.curedCount
				this.caseNumData.deadCount = res.data.newslist[0].desc.deadCount
				this.caseNumData.seriousCount = res.data.newslist[0].desc.seriousCount
				this.caseNumData.suspectedIncr = res.data.newslist[0].desc.suspectedIncr
				this.caseNumData.currentConfirmedIncr = res.data.newslist[0].desc.currentConfirmedIncr
				this.caseNumData.confirmedIncr = res.data.newslist[0].desc.confirmedIncr
				this.caseNumData.curedIncr = res.data.newslist[0].desc.curedIncr
				this.caseNumData.deadIncr = res.data.newslist[0].desc.deadIncr
				this.caseNumData.seriousIncr = res.data.newslist[0].desc.seriousIncr

				this.newsData = res.data.newslist[0].news
			}).catch(error => {
				console.log(error);
			})
		}
	}
</script>

<style>
</style>
